
function ImageButton(a, b, c) {
    this.initialize();
    a = new createjs.Bitmap(queue.getResult(a));  //创建位图
    b && (b = new createjs.Bitmap(queue.getResult(b)), this.addChild(b), a.x = (b.image.width - a.image.width) / 2, a.y = (b.image.height - a.image.height) / 2);
    this.addChild(a);
    c && (c = this.getBounds(), this.regX = c.width / 2, this.regY = c.height / 2);
    this.on("mousedown", function () {
        this._addFilter(new createjs.ColorMatrixFilter((new createjs.ColorMatrix).adjustBrightness(-80)), "mouse");
    }, this);
    this.on("pressup", function () {
        this._removeFilter("mouse");
    }, this);
}
ImageButton.prototype = new createjs.Container;
ImageButton.prototype._addFilter = function (a, b) {
    a.tag = b;
    if (this.filters) {
        for (var c in this.filters) {
            if (this.filters[c].tag == b) {
                return;
            }
        }
        this.filters.push(a);
    } else {
        this.filters = [a];
    }
    this.do_cache();
};
ImageButton.prototype._removeFilter = function (a) {
    if (this.filters) {
        var b = [], c;
        for (c in this.filters) {
            var d = this.filters[c];
            a != d.tag && b.push(d);
        }
        this.filters = b;
        this.do_cache();
    }
};
ImageButton.prototype.setEnabled = function (a) {
    (this.mouseEnabled = a) ? this._removeFilter("disable") : (a = new createjs.ColorMatrixFilter((new createjs.ColorMatrix).adjustBrightness(-80).adjustSaturation(-100)), this._addFilter(a, "disable"));
};